<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      html {
        font-size: 50px;
      }

      #app {
        display: flex;
        flex-direction: column;
        align-items: center;
      }

      header {
        width: 6.4rem;
        height: 0.88rem;
        background-color: #0cc53f;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      header div {
        width: 1.2rem;
        height: 0.5rem;
        font-size: 0.24rem;
        color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .hot {
        border-radius: 0.25rem 0 0 0.25rem;
        background-color: #63da85;
      }
      .sub {
        border-radius: 0 0.25rem 0.25rem 0;
        background-color: #3cd166;
      }

      nav {
        width: 6.4rem;
        height: 0.7rem;
        border-bottom: 1px solid #d9d9d9;
        display: flex;
      }
      .navItem {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.26rem;
        color: #656565;
      }
      .navItem:first-child {
        color: #0cc53f;
        position: relative;
        /* border-bottom: 3px solid #0cc53f;
        border-top: 3px solid transparent; */
      }
      .navItem:first-child::after {
        content: "";
        width: 100%;
        height: 0.06rem;
        background-color: #0cc53f;
        position: absolute;
        left: 0;
        bottom: 0;
      }

      main {
        width: 6.4rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
      }
      .mainItem {
        width: 3.16rem;
        height: 3.74rem;
        border: 1px solid #d9d9d9;
        margin-top: 0.08rem;
        display: flex;
        flex-direction: column;
      }

      .mainItem img {
        width: 100%;
        height: 3.16rem;
      }
      .mainItem span {
        flex: 1;
        font-size: 0.2rem;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <header>
        <div class="hot">热点</div>
        <div class="sub">关注</div>
      </header>

      <nav>
        <div class="navItem">足球现场</div>
        <div class="navItem">足球生活</div>
        <div class="navItem">足球美女</div>
      </nav>

      <main>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
        <div class="mainItem">
          <img src="../day01/images/1.jpg" alt="" />
          <span>小丸子啊小丸子</span>
        </div>
      </main>
    </div>

    <script>
      // script标签里面写的就是js代码
      // console.log()可以在浏览器的控制台输出内容
      // document.documentElement.clientWidth表示设备宽度
      // console.log(document.documentElement.clientWidth);

      // console.log((document.documentElement.clientWidth * 50) / 320);
      document.documentElement.style.fontSize =
        (document.documentElement.clientWidth * 50) / 320 + "px";
    </script>
  </body>
</html>
